import request from '@/config/axios'

// 投稿 VO
export interface SubmitActivityVO {
  id: number // 编号
  studentId: number // 学生编号
  activityId: number // 活动编号
  workId: number // 作评编号
}

// 投稿 API
export const SubmitActivityApi = {
  // 查询投稿分页
  getSubmitActivityPage: async (params: any) => {
    return await request.get({ url: `/td/submit-activity/page`, params })
  },

  // 查询投稿详情
  getSubmitActivity: async (id: number) => {
    return await request.get({ url: `/td/submit-activity/get?id=` + id })
  },

  // 新增投稿
  createSubmitActivity: async (data: SubmitActivityVO) => {
    return await request.post({ url: `/td/submit-activity/create`, data })
  },

  // 修改投稿
  updateSubmitActivity: async (data: SubmitActivityVO) => {
    return await request.put({ url: `/td/submit-activity/update`, data })
  },

  // 删除投稿
  deleteSubmitActivity: async (id: number) => {
    return await request.delete({ url: `/td/submit-activity/delete?id=` + id })
  },

  // 导出投稿 Excel
  exportSubmitActivity: async (params) => {
    return await request.download({ url: `/td/submit-activity/export-excel`, params })
  },
}